package com.kly.chatter.api.application.controller.chatter.req;


import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.CollectionUtils;
import com.kly.sc.api.infras.exception.ApplicationException;
import com.kly.sc.api.infras.utils.StringUtils;
import lombok.Data;

import java.util.List;

/**
 * @author linqu
 */
@Data
public class ModelUserCodeListReq extends ParamsObject {

    /**
     * chatter用户码
     */
    private String chatterUserCode;
    /**
     * 聊天用户
     */
    private List<ChatUser> chatUsers;

    @Override
    public void validate() {
        if (StringUtils.isEmpty(this.chatterUserCode)) {
            throw new ApplicationException("The parameter [chatterUserCode] should not be empty");
        }
        if (CollectionUtils.isEmpty(this.chatUsers)) {
            throw new ApplicationException("The parameter [chatUsers] should not be empty");
        }
    }
}